package com.bw.gmall.realtime.dwd.db.split.app;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

public class Test2 {
    public static void main(String[] args) {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        StreamTableEnvironment tableEnv  = StreamTableEnvironment.create(env);

        tableEnv.executeSql("CREATE TABLE test3 (\n" +
                "  `i` STRING,\n" +
                "  `s` BIGINT\n" +
                ") WITH (\n" +
                "  'connector' = 'kafka',\n" +
                "  'topic' = 'my_test_top_2',\n" +
                "  'properties.group.id' = 'testGroup1',\n" +
                "  'scan.startup.mode' = 'latest-offset',\n" +
                "  'properties.bootstrap.servers' = 'hadoop102:9092',\n" +
                "  'format' = 'json'\n" +
                ")");
        tableEnv.sqlQuery("select * from test3").execute().print();
    }
}
